////////////////////////////////////////////////////////
// CodePlex - metacpp
//--------------------
// This file is part of "metacpp" project on CodePlex. The
// goal if the project is to demonstrate basic techniques
// used in C++ metaprogrammins.
// For more info and comments please visit:
// http://www.codeplex.com/metacpp/
////////////////////////////////////////////////////////

#include <iostream>

template<int NUM>
struct factorial {
	enum { value = NUM * factorial<NUM-1>::value };
};

template<>
struct factorial<1> {
	enum { value = 1 };
};


void test_factorial(void) {
	std::cout << "STATIC_FACTORIAL:" << std::endl;
	std::cout << "factorial(5)=" << factorial<5>::value << std::endl;
	std::cout << "factorial(10)=" << factorial<10>::value << std::endl;
}